//
//  RBGNavigationBar.m
//  BateauGenerique
//
//  Created by Kevin De Jesus Ferreira on 23/05/2014.
//  Copyright (c) 2014 Kevin De Jesus Ferreira. All rights reserved.
//

#import "RBGNavigationBar.h"

@implementation RBGNavigationBar

+(void) customNavigationBar:(UINavigationController *)navigationController
                   andTitle:(NSString *)title
         andBackgroundColor:(UIColor *)backgroundColor
               andTextColor:(UIColor *)textColor
{
    
    // On change le fond de la navigation bar
    [navigationController.navigationBar setBackgroundColor:backgroundColor];
    
    // On change le titre de la navigation bar
    [navigationController.navigationBar.topItem setTitle:title];

    navigationController.navigationBar.barTintColor = backgroundColor;
    navigationController.navigationBar.tintColor = textColor;
    [navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : textColor}];
        navigationController.navigationBar.translucent = NO;
    
    
    UIBarButtonItem *newBackButton = [[UIBarButtonItem alloc] initWithTitle: @"Retour" style: UIBarButtonItemStyleBordered target: nil action: nil];
    [navigationController.navigationItem setBackBarButtonItem:newBackButton];
    
}

@end
